<?php

namespace App\Providers;

use Illuminate\Support\ServiceProvider;
//use Illuminate\Support\Facades\Validator;
use Validator;
class AppServiceProvider extends ServiceProvider
{
    /**
     * Register any application services.
     *
     * @return void
     */
    /**
     * 注册服务提供器
     *
     * @return void
     */
    public function register()
    {
        //
    }

    /**
     * 驱动应用服务
     *
     * @return void
     */
    public function boot()
    {
        //自定义验证规则
        //参数1 规则名 phone
//        Validator::extend('phone', function ($attribute, $value, $parameters, $validator) {
//            //返回true false
//            $reg ='/^1[3-9]\d{9}$/';
//            return  preg_match($reg,$value);
//        });
    }
}
